﻿using System;

namespace UDS
{
    /// <summary>
    /// Provider several methods for SQL operations.
    /// </summary>
    internal static class SQLUtil
    {
        internal static int ReadInt32(object obj, int defaultValue)
        {
            if (obj == null || obj == DBNull.Value)
            {
                return defaultValue;
            }
            return (int)obj;
        }

        internal static DateTime ReadDataTime(object obj, DateTime defaultValue)
        {
            if (obj == null || obj == DBNull.Value)
            {
                return defaultValue;
            }
            return (DateTime)obj;
        }
    }
}
